ActionController::Routing::Routes.draw do |map|

  map.resources :programs
  map.resources :sites
  map.resources :groups
  map.resources :runners
  map.resources :entries
  map.resources :incentives
  map.resources :landmarks
  map.resources :routes
  
  map.resources :users


  # The priority is based upon order of creation: first created -> highest priority.

  # Sample of regular route:
  #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   map.resources :products

  # Sample resource route with options:
  #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }

  # Sample resource route with sub-resources:
  #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
  
  # Sample resource route with more complex sub-resources
  #   map.resources :products do |products|
  #     products.resources :comments
  #     products.resources :sales, :collection => { :recent => :get }
  #   end

  # Sample resource route within a namespace:
  #   map.namespace :admin do |admin|
  #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
  #     admin.resources :products
  #   end
  map.trophy_rooms '/trophy_rooms/:id', :controller => 'trophy_rooms', :action => 'show'
  map.home '', :controller => 'home', :action => 'home'
  map.index '', :controller => 'home', :action=> 'home'
  map.bulk_update '/groups/:id/bulk_update', :controller => 'runners', :action => 'bulk_update'
  map.map '/runners/:id/map', :controller => 'runners', :action => 'map'
  map.gmap '/groups/:id/map', :controller => 'groups', :action => 'map'
  map.defaultroutes '/routesite/defaults', :controller => 'routes', :action => 'defaults'
  map.siteeditroute '/site/:id/route', :controller => 'sites', :action => 'route'

  map.login '/login/', :controller => 'account', :action => 'login'
  map.logout '/logout/', :controller => 'account', :action => 'logout'
  map.studentlogin '/student/', :controller => 'account', :action => 'studentlogin'
  
  # See how all your routes lay out with "rake routes"

  # Install the default routes as the lowest priority.
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
